package com.acsior.hibernate.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.dac.impl.hibernate.vo.HibernatePersistantIntegerIdVO;

/**
 * StockItem entity. @author MyEclipse Persistence Tools <b><i>powered by
 * Belev</i></b>
 */
@Entity
@Table(name = "stock_items")
@GeneratorKey(tableName = "stock_items")
public class StockItemVO extends HibernatePersistantIntegerIdVO {

	private static final long serialVersionUID = -975687816720582037L;

	@Column(name = "available_quantity")
	private Integer availableQuantity;

	@Column(name = "description")
	private String description;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "postal_item_id", nullable = false)
	private PostalItemVO postalItem;

	@Column(name = "stock_price", nullable = false, scale = 4)
	private double stockPrice;

	/** default constructor */
	public StockItemVO() {
		super();
	}

	/** @return the availableQuantity */
	public Integer getAvailableQuantity() {
		return this.availableQuantity;
	}

	/** @return the description */
	public String getDescription() {
		return this.description;
	}

	/** @return the postalItem */
	public PostalItemVO getPostalItem() {
		return this.postalItem;
	}

	/** @return the stockPrice */
	public double getStockPrice() {
		return this.stockPrice;
	}

	/**
	 * @param availableQuantity
	 *            the availableQuantity to set
	 */
	public void setAvailableQuantity(Integer availableQuantity) {
		this.availableQuantity = availableQuantity;
	}

	/**
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @param postalItem
	 *            the postalItem to set
	 */
	public void setPostalItem(PostalItemVO postalItem) {
		this.postalItem = postalItem;
	}

	/**
	 * @param stockPrice
	 *            the stockPrice to set
	 */
	public void setStockPrice(double stockPrice) {
		this.stockPrice = stockPrice;
	}

}